#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive

${HIVE_HOME} -S -e "
drop table edu_dwd.ft_edu_dwd_web_chat_ems_2019_07;
create table edu_dwd.ft_edu_dwd_web_chat_ems_2019_07(
id int,
create_date_time timestamp,
session_id string,
sid string,
create_time timestamp,
seo_source string,
seo_keywords string,
ip string,
area string,
country string,
province string,
city string,
origin_channel string,
`user` string,
manual_time timestamp,
begin_time timestamp,
end_time timestamp,
last_customer_msg_time_stamp timestamp,
last_agent_msg_time_stamp timestamp,
reply_msg_count int,
msg_count int,
browser_name string,
os_info string
) row format delimited fields terminated by '\t'
stored as orc tblproperties ('orc.compress' = 'SNAPPY');

create table edu_dwd.ft_edu_dwd_web_chat_text_ems_2019_07(
id int,
referrer string,
from_url string,
landing_page_url string,
url_title string,
platform_description string,
other_params string,
history string
) row format delimited fields terminated by '\t'
stored as orc tblproperties ('orc.compress' = 'SNAPPY');
"